1.2.0
New:
New cosmetic filter to foil specific inline script tags -- one more tool in uBlock Origin's arsenal against bloat. Syntax of this new cosmetic filter is:
example.com##script:contains(...)
Where ...
is a plain string or a regular expression. If ...
is a string in between /
like /.../
, the string is treated as a literal javascript regular expression, otherwise it is treated as a plain string.
Caveats of current implementation:
- The filter must apply to a specific hostname or entity. Generic script tag filters will be rejected.
- This works only on not too old versions of Firefox: this feature makes use of the
beforescriptexecute
event, and this event is not supported on Chromium-based browsers.- Starring the related Chromium issue may motivate developers to bring support of
beforescriptexecute
to Chromium.
- Starring the related Chromium issue may motivate developers to bring support of
Excellent example of the usefulness of this new cosmetic filter:
- Enable "DEU: EasyList Germany" in 3rd-party filters pane in the dashboard.
- Go to http://www.focus.de/.
- See site purposefully defacing itself with obnoxious click-bait ads.
- Go to My filters pane in the dashboard.
- Add custom cosmetic filter
www.focus.de##script:contains(uabInject)
. - Reload http://www.focus.de/.
- No more obnoxious click-bait ads.
- Another example:
explosm.net##script:contains(/^__durl=/)
for http://explosm.net/.
Blocking inline script tags for that site would prevent site-defacing ads from appearing, but this is a broad approach which can result in other useful functionality on the site being disabled as well. The new script tag cosmetic filter syntax allows a more refined approach by blocking one or more specific inline script tags on a page. Blocking all inline script is preferred if this does not lead to the site losing useful functionalities. But if this happens, a specific script tag filter is the solution.
Closed as fixed:
Chromium
Firefox
Core
- Create landing pages in the wiki for features with caveats
- Can we have link to docs under My Filters tab?
- Site loading constantly with uBlock: eg. AdFox, AdRiver, Magna problem
- Solved though the use of the new inline script tag filtering.